<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <!-- 引入Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- 引入Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <!-- 配置Tailwind自定义颜色和字体 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CFC9',
                        accent: '#722ED1',
                        dark: '#1D2129',
                        light: '#F2F3F5'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>

    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-shadow {
                box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
            }
            .input-focus {
                @apply border-primary ring-2 ring-primary/20;
            }
            .btn-hover {
                @apply transform hover:scale-105 transition-all duration-300;
            }
        }
    </style>
</head>
<body class="bg-gradient-to-br from-light to-gray-200 min-h-screen flex items-center justify-center font-inter">
<!-- 背景装饰元素 -->
<div class="fixed inset-0 overflow-hidden pointer-events-none">
    <div class="absolute -top-20 -right-20 w-80 h-80 bg-primary/5 rounded-full blur-3xl"></div>
    <div class="absolute -bottom-20 -left-20 w-80 h-80 bg-secondary/5 rounded-full blur-3xl"></div>
</div>

<!-- 登录卡片 -->
<div class="relative z-10 w-full max-w-md mx-4">
    <div class="bg-white rounded-2xl p-8 card-shadow transform transition-all duration-500 hover:shadow-xl">
        <!-- 标题和图标 -->
        <div class="text-center mb-8">
            <div class="w-16 h-16 bg-primary rounded-xl flex items-center justify-center mx-auto mb-4">
                <i class="fa fa-user-circle text-white text-3xl"></i>
            </div>
            <h1 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">用户登录</h1>
            <p class="text-gray-500 mt-2">请输入您的账号和密码</p>
        </div>

        <!-- 登录表单 -->
        <form action="/login" method="post" class="space-y-5">
            <!-- 用户名输入框 -->
            <div class="relative">
                <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
                    <i class="fa fa-user text-gray-400"></i>
                </div>
                <input type="text" id="username" name="username" required
                       class="block w-full pl-10 pr-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-focus transition-all duration-300"
                       placeholder="用户名">
            </div>

            <!-- 密码输入框 -->
            <div class="relative">
                <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
                    <i class="fa fa-lock text-gray-400"></i>
                </div>
                <input type="password" id="password" name="password" required
                       class="block w-full pl-10 pr-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-focus transition-all duration-300"
                       placeholder="密码">
            </div>

            <!-- 隐藏字段用于存储用户ID -->
            <input type="hidden" id="userId" name="userId">

            <!-- 登录按钮 -->
            <button type="submit" class="w-full bg-primary hover:bg-primary/90 text-white font-semibold py-3 px-4 rounded-lg shadow-lg shadow-primary/20 btn-hover">
                登录
            </button>
        </form>



        <!-- 注册链接 -->
        <div class="mt-6 text-center">
            <p class="text-gray-600">
                还没有账号? <a href="/register" class="text-primary hover:text-primary/80 font-medium transition-colors duration-300">注册</a>
            </p>
        </div>
    </div>

    <!-- 页脚 -->
    <div class="mt-6 text-center text-gray-500 text-sm">
        <p>© 2025 GameStore. 保留所有权利</p>
    </div>
</div>

<!-- 动画效果 -->
<script>
    // 页面加载动画
    document.addEventListener('DOMContentLoaded', function() {
        const loginCard = document.querySelector('.max-w-md');
        loginCard.classList.add('opacity-0', 'translate-y-8');

        setTimeout(() => {
            loginCard.classList.remove('opacity-0', 'translate-y-8');
            loginCard.classList.add('opacity-100', 'translate-y-0');
        }, 100);
    });
</script>
</body>
</html>
